package com.mine.frame.mylandemo.ui

import android.content.Intent
import android.os.Bundle
import com.blankj.utilcode.util.ActivityUtils
import com.blankj.utilcode.util.ClickUtils
import com.mine.frame.common.base.BaseActivity
import com.mine.frame.common.empty.EmptyPresenter
import com.mine.frame.common.empty.IEmpty
import com.mine.frame.mylandemo.R
import com.mine.frame.mylandemo.ui.jiecang.LiftCabinetAtv
import com.mine.frame.mylandemo.ui.jiecang.TranslationDeskAtv
import com.mine.frame.mylandemo.ui.jiecang.TwoDevControlAtv
import com.mine.frame.mylandemo.ui.oupaike.BusDoorAtv
import kotlinx.android.synthetic.main.atv_e_hall.*

/**
 * @Date 2022/4/12
 * Description:
 */
class EHallAtv : BaseActivity<IEmpty, EmptyPresenter>(), IEmpty {
    override fun initLayoutId(): Int = R.layout.atv_e_hall

    override fun initPresenter(): EmptyPresenter = EmptyPresenter(this)

    override fun initLayoutAfter(savedInstanceState: Bundle?) {

        ClickUtils.applySingleDebouncing(arrayOf(btnSJ ,btnTY,btn2, btn3, btn41, btn42)) {
            when (it.id) {
                R.id.btnSJ -> {// 设置 厨房 升降柜记忆位置
                    val intent = Intent(this@EHallAtv, LiftCabinetAtv::class.java)
                    intent.putExtra("sel-ip", "172.168.111.201")
                    ActivityUtils.startActivity(intent)
                }

                R.id.btnTY -> {// 设置 厨房 平移导台记忆位置
                    val intent = Intent(this@EHallAtv , TranslationDeskAtv::class.java)
                    //intent.putExtra("sel-ip" ,"192.168.0.177")
                    intent.putExtra("sel-ip" ,"172.168.111.202")
                    ActivityUtils.startActivity(intent)
                }

                R.id.btn2 -> {// 2区 厨房 升降柜 和 平移导台
                    ActivityUtils.startActivity(TwoDevControlAtv::class.java)
                }
                R.id.btn3 -> {// 3区 衣帽间 升降台梳妆台
                    val intent = Intent(this@EHallAtv , TranslationDeskAtv::class.java)
                    //intent.putExtra("sel-ip" ,"192.168.0.177")
                    intent.putExtra("sel-ip" ,"172.168.111.203")
                    ActivityUtils.startActivity(intent)
                }
                R.id.btn41 -> {// 4区 卧室 升降柜
                    val intent = Intent(this@EHallAtv, LiftCabinetAtv::class.java)
                    intent.putExtra("sel-ip", "172.168.111.204")
                    ActivityUtils.startActivity(intent)

                }
                R.id.btn42 -> {// 4区 客厅 巴士门
                    val intent = Intent(this@EHallAtv, BusDoorAtv::class.java)
                    intent.putExtra("sel-ip", "172.168.111.205")
                    ActivityUtils.startActivity(intent)
                }
            }
        }
    }
}